from http import cookiejar

import requests

cookie = cookiejar.MozillaCookieJar('base.cookie')
#先加载cookie
cookie.load(ignore_discard=True,ignore_expires=True)
# print(cookie)
sc = ''
#遍历cookie
for c in cookie:
    #创建cookie代码
    sc+=f'{c.name}={c.value};'
#创建headers来调用
headers = {
    'cookie':sc
}
url = 'http://192.168.1.240/admin/user'
print(requests.get(url,headers=headers).text)